<?php
/*
|--------------------------------------------------------------------------
| 货主端  Routes
|--------------------------------------------------------------------------
|公共路由部分
*/


/*
|--------------------------------------------------------------------------
| Owner Routes
|--------------------------------------------------------------------------
| 货主pc端
*/
Route::group(['namespace' => 'Owner', 'prefix' => 'owner', 'middleware' => 'owner_pc'], function () {
    Route::get('/', 'IndexController@layout')->name('owner.layout'); //后台布局
    //后台首页
    Route::get('/index', 'IndexController@index')->name('owner.index');
    //司机列表页面
    Route::get('/driver', 'DriverController@index')->name('owner.driver');
    Route::get('/driver/select', 'DriverController@indexSelect')->name('owner.select');
    //获取司机列表的接口
    Route::get('/driver/data', 'DriverController@data')->name('owner.driver.data');
    //导入司机通讯录
    Route::post('/driver/mail', 'DriverController@importDrivers')->name('owner.driver.importdriver');
    //删除一个司机
    Route::post('/driver/del', 'DriverController@changeStatus')->name('owner.driver.del');
    //发送短信--标签方式
    Route::get('/driver/send', 'SendSmsController@add')->name('owner.driver.sendmsg');
    //获取某个货主的标签
    Route::get('/driver/getdrivermail', 'SendSmsController@getDriverMailList')->name('owner.driver.getdrivermail');
    //发送短信--通讯录方式
    Route::get('/driver/sendmail', 'SendSmsController@selectAdd')->name('owner.driver.sendmail');
    //保存通讯录标签
    Route::post('/driver/lableadd', 'DriverLabelController@store')->name('owner.driverlabel.store');
    //发送短信--标签方式
    Route::post('/driver/sendLabel', 'SendSmsController@label')->name('owner.driver.sendlabel');
    //发送记录
    Route::get('/driver/sendlog', 'SendSmsController@log')->name('owner.driver.sendlog');
    Route::get('/driver/sendlogdata', 'SendSmsController@data')->name('owner.driver.sendlogdata');
});

Route::group(['namespace' => 'Owner', 'prefix' => 'owner'], function () {
    //登录、注销
    Route::get('login', 'LoginController@showLoginForm')->name('owner.ownerForm');
    Route::post('loginon', 'LoginController@login')->name('owner.login');
    Route::get('logout', 'LoginController@loginout')->name('owner.logout');
    Route::get('flush', 'IndexController@flush')->name('owner.flush'); //清空缓存

});



